package com.epfresh.api.widget.lines;

/**
 * @author wangzhanghuan
 * @version 1.0
 * @date create 17-5-9
 * @Description
 */

public class Donut {

//
//    "name": null,
//            "categoryId": 1,
//            "categoryName": "蔬菜",
//            "queryDate": "2017-03",
//            "categoryIds": "1",
//            "price": 26571.79,
//            "ratio": 0.84

    private String ratio;
    private String name;

    private float degree;
    private int color;

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public float getRatioFloat() {
        try{
            if (ratio != null && !"".equals(ratio)){
                return Float.valueOf(ratio) * 100;
            }
        }catch (Exception e){
            e.printStackTrace();
        }

        return 0.01f;
    }
    public String getRatio() {
        return ratio;
    }
    public String getRatioStr() {

        try{
            if (ratio != null && !"".equals(ratio)){
                return (int)(Float.valueOf(ratio) * 100) + "%";
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return "";
    }

    public void setRatio(String ratio) {
        this.ratio = ratio;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getDegree() {
        return degree;
    }

    public void setDegree(float degree) {
        this.degree = degree;
    }


}
